﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>INPC Property</Title>
      <Author>Laurent Bugnion (GalaSoft)</Author>
      <Description>A property raising PropertyChanged with a string. The class using this property should inherit GalaSoft.MvvmLight.ObservableObject. (V5.1.8.0)</Description>
      <HelpUrl>http://www.mvvmlight.net</HelpUrl>
      <Shortcut>mvvminpc</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>Type</ID>
          <ToolTip>Property type</ToolTip>
          <Default>bool</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>AttributeName</ID>
          <ToolTip>Attribute name</ToolTip>
          <Default>_myProperty</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>InitialValue</ID>
          <ToolTip>Initial value</ToolTip>
          <Default>false</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>PropertyName</ID>
          <ToolTip>Property name</ToolTip>
          <Default>MyProperty</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="csharp"><![CDATA[/// <summary>
        /// The <see cref="$PropertyName$" /> property's name.
        /// </summary>
        public const string $PropertyName$PropertyName = "$PropertyName$";

        private $Type$ $AttributeName$ = $InitialValue$;

        /// <summary>
        /// Sets and gets the $PropertyName$ property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public $Type$ $PropertyName$
        {
            get
            {
                return $AttributeName$;
            }

            set
            {
                if ($AttributeName$ == value)
                {
                    return;
                }

                $AttributeName$ = value;
                RaisePropertyChanged($PropertyName$PropertyName);
            }
        }]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>